<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>获得正整数最高位</title>
		<script type="text/javascript">
			function get(number) {
				while (true) {
					if (number % 10 == number) {
						return number;
					}
					number=number/10;
					number=parseInt(number);
				}			
			}
			var num=get(prompt("输入一个正整数"));
			alert(num);
		</script>
	</head>
	<body>
	</body>
</html>
